<!-- MyComponent.vue -->
<template>
  <h1>Hello {{ name }}</h1>
</template>

<script lang="ts">

export default {
  name: 'ChildComponent',
  props: {
    // name: String,
    // 增加类型，默认值
    // name: {
    //   type: String,
    //   default: 'Child Component'
    // }
    // 添加验证
    name: {
      type: String,
      required: true,
      validator: value => value !== "Child Component"
    }
  }
}
</script>
